Skip to content

[KAN-382] Fix Transaction Propagation in ExcursionReviewRepository - #147

Closed
huytran2005 wants to merge 4 commits into
mainfrom
fix/KAN-382-requires-new-repo-18206693641074511826
Closed

huytran2005 wants to merge 4 commits into
mainfrom
fix/KAN-382-requires-new-repo-18206693641074511826

Conversation

@huytran2005

Copy link
Copy Markdown
Contributor

Fixes a transaction anti-pattern where a Spring Data repository method had @Transactional(propagation = Propagation.REQUIRES_NEW), forcing all saves to create new transactions. Instead, this moves the isolation logic to a dedicated writer component called specifically by the service during idempotent save attempts.


PR created automatically by Jules for task 18206693641074511826 started by @huytran2005

…ES_NEW) from ExcursionReviewRepository.save

Refactored ExcursionReviewService to use a dedicated ExcursionReviewItemWriter component to isolate transactions for duplicate/constraint violation resilience without modifying the transaction semantics of the Spring Data JPA repository. Added tests to verify changes.

Co-authored-by: huytran2005 <[email protected]>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

google-labs-jules Bot and others added 3 commits November 9, 2026 12:09
…Test

Removed `@Transactional(propagation = Propagation.REQUIRES_NEW)` from `ExcursionReviewRepository.save` in `cruise-activity-service` and moved isolation logic to a dedicated `ExcursionReviewItemWriter`.

Additionally, specified `columnDefinition = "bytea"` for `fileData` (which is a byte array mapped as `@Lob`) on `ReportExportJob` in `cruise-pos-service` because H2 in PostgreSQL mode does not recognize "blob" appropriately and throws an unknown data type error when running tests that try to create `pos_report_export_jobs`.

Co-authored-by: huytran2005 <[email protected]>
Fixed CI by setting Java version from '25' to '21' as Java 21 LTS is used.
Also removed `@Transactional(propagation = Propagation.REQUIRES_NEW)` from `ExcursionReviewRepository.save` in `cruise-activity-service` and moved isolation logic to a dedicated `ExcursionReviewItemWriter`.

Additionally, specified `columnDefinition = "bytea"` for `fileData` (which is a byte array mapped as `@Lob`) on `ReportExportJob` in `cruise-pos-service` because H2 in PostgreSQL mode does not recognize "blob" appropriately and throws an unknown data type error when running tests that try to create `pos_report_export_jobs`.

Co-authored-by: huytran2005 <[email protected]>
…lugin

Fixed CI by setting Java version from '25' to '21' as Java 21 LTS is used.
Downgraded `sonar-maven-plugin` to `4.0.0.4121` because version `5.8.0.7211` has a known issue where it attempts to query JRE metadata from SonarCloud (`https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64`) and receives a 403 Forbidden error, causing the CI pipeline to fail during the SonarCloud analysis phase.

Also removed `@Transactional(propagation = Propagation.REQUIRES_NEW)` from `ExcursionReviewRepository.save` in `cruise-activity-service` and moved isolation logic to a dedicated `ExcursionReviewItemWriter`.

Additionally, specified `columnDefinition = "bytea"` for `fileData` (which is a byte array mapped as `@Lob`) on `ReportExportJob` in `cruise-pos-service` because H2 in PostgreSQL mode does not recognize "blob" appropriately and throws an unknown data type error when running tests that try to create `pos_report_export_jobs`.

Co-authored-by: huytran2005 <[email protected]>
@huytran2005

Copy link
Copy Markdown
Contributor Author

Closing redundant draft PR created by automated bot.

@huytran2005
huytran2005 deleted the fix/KAN-382-requires-new-repo-18206693641074511826 branch November 15, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant